package entity

// Sale 代表定价出售信息
type Sale struct {
	DCI    string `json:"dci,omitempty" required:"true"`
	Seller string `json:"seller,omitempty" required:"true"`
	Buyer  string `json:"buyer,omitempty"`
	Price  string `json:"price,omitempty" required:"true"`

	Name            string `json:"name,omitempty" required:"true"`
	Description     string `json:"description,omitempty" required:"true"`
	Category        string `json:"category,omitempty"`
	BlockTime       uint64 `json:"blockTime,omitempty" required:"true" example:"14000000"`
	BlockTimeString string `json:"blockTimeString,omitempty" required:"true" example:"2020-01-01 01:01:01"`
}

type SaleEvent struct {
}

// GetSaleUri 获取指定 Sale 请求
type GetSaleUri struct {
	DCI string `uri:"dci" binding:"required" path:"dci" required:"true" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
}

// GetSaleResponse 获取指定 Sale 响应
type GetSaleResponse struct {
	Response
	Data Sale `json:"data,omitempty"`
}

// GetSalesQuery 查询 Sale 集合请求
type GetSalesQuery struct {
	Pagination
	BlockTimeSearch
	NameSearch
	ItemTypeSearch
	DCI    string `form:"dci" binding:"-" query:"dci" example:"0x3e6cf1025bc0852b7141ab19a097305a3935ebb9cc23d4f507c6ccce112be73c"`
	Seller string `form:"seller" binding:"-" query:"seller" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	Buyer  string `form:"buyer" binding:"-" query:"buyer" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
}

// GetSalesResponse 查询 Sale 集合响应
type GetSalesResponse struct {
	Response
	Data []Sale `json:"data,omitempty"`
}

type GetSaleEvents struct {
	Pagination
	From      string `form:"from" binding:"-" query:"from" json:"from" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	To        string `form:"to" binding:"-" query:"to" json:"to" example:"0xfC97a1A683FB0108299D5725BC9d72899C9A86B4"`
	EventName string `form:"eventName" binding:"-" query:"eventName" json:"eventName" example:"create"`
}
